package com.niit.main;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.niit.entity.Student;
import com.niit.util.MybatisUtil;

/**
 ** 根据班级名称查询学生列表
 *
 * @author hanliang
 */
public class Test05_getStudentsByBatch {

    public static void main(String[] args) {

        List<Student> list = null;
        String batchName="22软件外包01班";

		try (SqlSession session = MybatisUtil.openSession()) {
			list = session.selectList("getStudentListByBatchName",batchName);
		}

		System.out.println("-------------------------------------------------------------------------------------------");
		System.out.println("学号\t\t姓名\t\t密码\t\t性别\t班级");
		System.out.println("-------------------------------------------------------------------------------------------");
        
        for (Student s : list) {
            System.out.println(s);
        }
    }
}
